<template>
  <view class="flex flex-col items-center justify-center py-[100rpx] bg-white rounded-[28rpx]">
    <view class="w-[160rpx] h-[160rpx] bg-gradient-to-br from-[#e3f2fd] to-[#bbdefb] rounded-full flex items-center justify-center mb-[30rpx]">
      <IconFont name="empty" size="80" color="#2196F3" />
    </view>
    <view class="text-[30rpx] font-medium text-[#666]">暂无{{ typeText }}发布内容</view>
    <view class="text-[24rpx] text-[#999] mt-[10rpx]">发布内容将展示在这里，快来创建吧</view>
    <nut-button 
      class="mt-[30rpx]"
      type="primary"
      @click="handlePublish"
    >
      <IconFont name="plus" size="20" class="mr-1" /> 发布新内容
    </nut-button>
  </view>
</template>

<script setup>
import { IconFont } from '@nutui/icons-vue-taro'
import { Button as nutButton } from '@nutui/nutui-taro'

// 接收类型参数
const props = defineProps({
  type: {
    type: Number,
    required: true,
    default: 0
  }
})

// 发布类型文本映射
const typeTextMap = ['日结', '悬赏', '招聘']
const typeText = typeTextMap[props.type]

// 向父组件传递发布事件
const emit = defineEmits(['publish'])

// 处理发布按钮点击
const handlePublish = () => {
  emit('publish', props.type)
}
</script>